<?php

class TestController extends Controller
{
	public function filters()
	{
		return array(
			'accessControl', // perform access control for CRUD operations
		);
	}

	public function accessRules(){
	    return array(/*
	        array('allow', // allow authenticated users to access all actions
				'users'=>array('@'),
			),
	        array('deny', // deny anything else
	              'users'=>array('*'),
	        ),*/
	    );
	}

    public function actionIndex()
    {   
            $this -> render('index',array(	

            ));
    }    
    
    public function actionUpdateTable()
    {
        $model = new Test();
        $items = $model -> updateTable();

        echo json_encode($items);        
    }     

	public function actionDemoUpload()
	{	
		if(Yii::app()->request->isPostRequest)
		{
			$fileUrl = $_POST["fileUrl"];
			Utility::saveImage($fileUrl, "1", "test");			
		}
		else
		{
			$this -> render('demoUpload',array(	
				
			));
		}
	}	
	
}